package com.open.common.enums;

/**
 * 公告类型枚举
 */
public enum NoticeEnum {
    NoticeType(1, "公告"),
    MessageType(2, "私信"),
    JumpType(98, "跳转页面"),
    WindowType(99, "强弹窗通知");

    private final Integer status;
    private final String name;

    NoticeEnum(Integer status, String name) {
        this.status = status;
        this.name = name;
    }

    public Integer getStatus() {
        return status;
    }

    public String getName() {
        return name;
    }

    public static NoticeEnum fromStatus(Integer status) {
        for (NoticeEnum log : NoticeEnum.values()) {
            if (log.getStatus().equals(status)) {
                return log;
            }
        }
        throw new IllegalArgumentException("Unknown status: " + status);
    }
}
